package com.kefu.robot.vo;

import javax.validation.constraints.NotEmpty;
import com.kefu.common.context.KefuContext;
import cn.hutool.core.bean.BeanUtil;
import com.kefu.common.vo.AbstractUpdateVo;
import com.kefu.robot.model.RobotAidataDoc;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
 * @author xiaoyu
 * @date 2023/11/03
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@ApiModel(description = "AI模型词条")
public class RobotAidataDocUpdateVo extends AbstractUpdateVo<RobotAidataDoc,String> {

    @NotEmpty
    @ApiModelProperty(value = "主键",required = true)
    private String docId;
    @ApiModelProperty(value = "AI模型id",required = true)
    private String aidataId;
    @ApiModelProperty(value = "分类Id")
    private String docTypeId;
    @ApiModelProperty(value = "名称")
    private String name;
    @ApiModelProperty(value = "类型： 0：文本 1：文件")
    private Integer type;
    @ApiModelProperty(value = "内容")
    private String content;
    @ApiModelProperty(value = "文件url")
    private String url;
    @ApiModelProperty(value = "文件名称")
    private String fileName;

    @Override
    public RobotAidataDoc convert() {
        RobotAidataDoc info  = BeanUtil.toBean(this, RobotAidataDoc.class);
        KefuContext context = KefuContext.getKefuContext();
        info.setUpdateTime(context.getNow());
        info.setUpdateUser(context.getUserId());
        return info;
	}
}